{% extends 'layout.html' %}
{% block title%}{{title}}{% endblock %}
{% block content %}
<div class="app-content-body fade-in-up">
    <div>
        <div class="hbox hbox-auto-xs hbox-auto-sm">
            <div class="col">
                <div style="background:url({{opposite.cover}}) center center; background-size:cover">
                    <div class="wrapper-lg bg-white-opacity">
                        <div class="row m-t">
                            <div class="col-sm-7">
                                <a href="" class="thumb-lg pull-left m-r avatar-user">
                                    <img src="{{opposite.avatar}}" class="img-circle">

                                    <div class="img-circle" title="1号会员">1</div>
                                </a>


                                <div class="clear m-b">


                                    <div class="m-b m-t-sm">
                                        <span class="h3 text-black">{{opposite.nickname}}</span>
                                        <small class="m-l">{{opposite.location}}</small>
                                        <small class="m-l">{{opposite.company}}</small>
                                    </div>
                                    <p class="m-b">
                                        <a href="{{opposite.github}}" class="btn btn-sm btn-bg btn-rounded btn-default btn-icon {% if !opposite.github %}disabled{% endif %}" target="_blank"><i class="fa fa-github"></i></a>
                                        <a href="{{opposite.weibo}}" class="btn btn-sm btn-bg btn-rounded btn-default btn-icon {% if !opposite.weibo %}disabled{% endif %}" target="_blank"><i class="fa fa-weibo"></i></a>
                                    </p>
                                    {% if user.nickname == opposite.nickname %}
                                    <a data-iswatch="1" class="btn btn-sm btn-success btn-rounded disabled">已关注</a>
                                    {% else %}
                                    <a id="watch" data-iswatch="{{iswatch}}" data-oppositeuid="{{opposite.id}}" href="javascript:;" class="btn btn-sm btn-success btn-rounded">
                                        {% if iswatch %}
                                        已关注
                                        {%else%}
                                        关注
                                        {%endif%}
                                    </a>
                                    {% endif %}
                                </div>


                            </div>
                            <div class="col-sm-5">
                                <div class="pull-right pull-none-xs text-center">
                                    <a href="" class="m-b-md inline m">
                                        <span class="h3 block font-bold">{{opposite.watchyou.length}}</span>
                                        <small>粉丝</small>
                                    </a>
                                    <a href="" class="m-b-md inline m">
                                        <span class="h3 block font-bold">{{opposite.youwatch.length}}</span>
                                        <small>关注</small>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="wrapper bg-white b-b text-center">
                    <div id="tab-user" class="btn-group">
                        <label class="btn btn-sm btn-info">
                            <i class="fa fa-check text-active"></i>
                            <a href="/user/{{opposite.nickname}}">{{opposite.nickname}}的主题</a>
                        </label>
                        <label class="btn btn-sm btn-success active">
                            <i class="fa fa-check text-active"></i>
                            <a href="/user/{{opposite.nickname}}/reply">{{opposite.nickname}}的回复</a>
                        </label>
                        <label class="btn btn-sm btn-primary">
                            <i class="fa fa-check text-active"></i>
                            <a href="/user/{{opposite.nickname}}/follow">{{opposite.nickname}}的追随</a>
                        </label>
                    </div>
                </div>


                <div class="profile-sh show padder">

                </div>



                <div id="v-more" class="wrapper panel">

                    <div class="panel-heading b-b b-light">
                        <span class="badge bg-warning pull-right">{{poststotal}}</span>
                        <a href="" class="font-bold">回复</a>
                    </div>



                    <ul class="list-group list-group-lg no-bg auto">

                        {% if !oppositeposts.length %}
                        <div class="wrapper-lg text-center">无数据</div>
                        {% endif %}

                        {% for oppositepost in oppositeposts %}
                        <li class="list-group-item clearfix">
                            <a href="{{oppositepost.url}}">
                                <div class="pull-right text-sm text-muted">
                                    <span class="hidden-xs ng-binding">{{oppositepost.createtime}}</span>
                                    <i class="fa fa-clock-o m-l-xs"></i>
                                </div>
                                <span class="pull-left thumb-sm avatar m-r">
                                  <img src="{{oppositepost.avatar}}" alt="...">
                                </span>
                                <span class="clear">
                                  <span><span class="text-info">{{opposite.nickname}}</span>&nbsp;&nbsp;回复&nbsp;&nbsp;<span class="text-info">{{oppositepost.obj}}</span></span>
                                  <small class="text-muted clear text-ellipsis">{{oppositepost.description}}</small>
                                </span>
                            </a>
                        </li>
                        {% endfor%}

                        <li v-cloak v-repeat="op:ops" class="list-group-item clearfix">
                            <a href="(%op.url%)">
                                <div class="pull-right text-sm text-muted">
                                    <span class="hidden-xs ng-binding">(%op.createtime%)</span>
                                    <i class="fa fa-clock-o m-l-xs"></i>
                                </div>
                                <span class="pull-left thumb-sm avatar m-r">
                                  <img src="(%op.avatar%)" alt="...">
                                </span>
                                <span class="clear">
                                  <span><span class="text-info">{{opposite.nickname}}</span>&nbsp;&nbsp;回复&nbsp;&nbsp;<span class="text-info">(%op.obj%)</span></span>
                                  <small class="text-muted clear text-ellipsis">(%op.description%)</small>
                                </span>
                            </a>
                        </li>


                    </ul>

                    <div v-cloak v-if="!!(extra>0)" class="clearfix panel-footer text-center">
                        <a href="javascript:;" class="auto" v-on="click:more">

                            <b v-if="!!(extra>0)" class="badge bg-info pull-right">(%extra%)</b>

                            <i class="fa fa-angle-double-down"></i>

                            <span>更多主题</span>
                        </a>
                    </div>
                </div>


            </div>





            <div class="col w-lg bg-light lter b-l bg-auto">
                <div class="wrapper">
                    <div>
                        <h4 class="m-t-xs m-b-xs">粉丝圈</h4>
                        <ul class="list-group no-bg no-borders ">
                            {% for like in likes %}
                            <li class="list-group-item">
                                <a href="/user/{{like.nickname}}" class="pull-left thumb-sm avatar m-r">
                                    <img src="{{like.avatar}}" class="img-circle">
                                </a>

                                <div class="clear">
                                    <div><a href="/user/{{like.nickname}}">{{like.nickname}}</a></div>
                                    <small class="text-muted">关注</small>
                                </div>
                            </li>
                            {% endfor %}
                            {% if !likes.length%}
                            <small class="text-muted">暂无粉丝</small>
                            {%endif%}
                        </ul>
                    </div>
                </div>
            </div>




        </div>
    </div>
</div>
{% endblock%}
{% block loadjs %}
<script>
    var remain = {{poststotal-10}},
    dataurl = '{{opposite.nickname}}'+'/reply';
    //comments
    require(['user/user.min']);
    //watch
    {% if user.nickname != opposite.nickname %}
        require(['user/watch.min']);
        {% endif %}
</script>
{% endblock %}
